(function(){  
	var ua=navigator.userAgent.toLowerCase();  
	var is=(ua.match(/\b(chrome|opera|safari|msie|firefox)\b/) || ['','mozilla'])[1];  
	var r='(?:'+is+'|version)[\\/: ]([\\d.]+)';  
	var v=(ua.match(new RegExp(r)) ||[])[1];  
	jQuery.browser.is=is; 
	jQuery.browser.ver=v;  
	jQuery.browser[is]=true;  
})();
(function (jQuery){
	this.version = '@1.0.2012';
	this.layer = {'width' : 252, 'height': 174};
	this.title = '信息提示';
	this.time = 1000*10;
	this.anims = {'type' : 'slide', 'speed' : 600};
	this.timer1 = null;
	
	this.inits = function(title, text,link){
		if($("#message").is("div")){ return; }
        $(document.body).prepend('<div id="message" class="message"><div class="tishi"><div class="ti-title"><img class="img06" src="/Images/06.png" border="0" /><span>提示信息</span><div class="ti-r"> <a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'Image2\',\'\',\'/Images/closered.gif\',1)"><img style="margin-top:0px;" id="message_close" src="/Images/close.gif" name="Image2" width="37" height="24" border="0" id="Image2" /></a></div></div><div class="ti-text"><div class="tit-ti">'+title+'</div><font><a class="ti-link" href="'+link+'"><span style="color:#005783;text-overflow:ellipsis;overflow:hidden;width:220px;height:82px;">'+text+'</span></a></font></div><div class="ti-more"><a class="timore" href="'+link+'"><span style="color:#005783;">查看更多</span></a></div></div></div>');
		$("#message_close").click(function(){	
			mySetTimeout(1);
		});
		$("#message").hover(function(){
			clearTimeout(timer1);
			timer1 = null;
		},function(){
			timer1 = mySetTimeout(time);
		});
	};	
	this.mySetTimeout = function(time){
		if(($.browser.is=='msie') && ($.browser.ver=='9.0')){
			setTimeout('$("#message").remove()',time);
		}else{
				setTimeout('this.close()', time);
		}
	};
	this.show = function(title, text, time,link){
		if($("#message").is("div")){ return; }
		if(title==0 || !title)title = this.title;
		this.inits(title, text,link);
		if(time>=0)this.time = time;
		switch(this.anims.type){
			case 'slide':$("#message").slideDown(this.anims.speed);break;
			case 'fade':$("#message").fadeIn(this.anims.speed);break;
			case 'show':$("#message").show(this.anims.speed);break;
			default:$("#message").slideDown(this.anims.speed);break;
		}		
		if($.browser.is=='chrome' || (($.browser.is=='msie') && ($.browser.ver='9.0'))){
			setTimeout(function(){
				$("#message").remove();
				this.inits(title, text,link);
				$("#message").css("display","block");
			},this.anims.speed-(this.anims.speed/5));
		}
		this.rmmessage(this.time);
	};
	this.lays = function(width, height){
		if($("#message").is("div")){ return; }
		if(width!=0 && width)this.layer.width = width;
		if(height!=0 && height)this.layer.height = height;
	}
	this.anim = function(type,speed){
		if($("#message").is("div")){ return; }
		if(type!=0 && type)this.anims.type = type;
		if(speed!=0 && speed){
			switch(speed){
				case 'slow' : ;break;
				case 'fast' : this.anims.speed = 200; break;
				case 'normal' : this.anims.speed = 400; break;
				default:					
					this.anims.speed = speed;
			}			
		}
	}
	this.rmmessage = function(time){
		if(time>0){			
			timer1 = mySetTimeout(time);
		}
	};
	this.close = function(){		
		switch(this.anims.type){
			case 'slide':$("#message").slideUp(this.anims.speed);break;
			case 'fade':$("#message").fadeOut(this.anims.speed);break;
			case 'show':$("#message").hide(this.anims.speed);break;
			default:$("#message").slideUp(this.anims.speed);break;
		};
		setTimeout('$("#message").remove();', this.anims.speed);
		this.original();	
	}
	this.original = function(){	
		this.layer = {'width' : 252, 'height': 174};
		this.title = '信息提示';
		this.time = 4000;
		this.anims = {'type' : 'slide', 'speed' : 600};
	};
    jQuery.messager = this;
    return jQuery;
})(jQuery);